﻿
Imports ZViewTVDotNet.SQLiteWrapper
Imports System.ComponentModel
Imports System.Reflection
Imports VideoLan
Imports System.Text
Imports System.Threading

Module player
    Private vlc As VideoLanClient
    Private vlcplayer As VlcMediaPlayer
    Private Desentrelacement As Deinterlace = Deinterlace.Off
    Private DesentrelacementMode As DeinterlaceMode = DeinterlaceMode.x
    Private RedimensionnementSoftware As Redimensionnement = Redimensionnement.Bicubic
    Private sautBoucle As SkipLoopFilter
    Private Recording As Boolean = False
    Private RecordFileName As String = "C:\test.ts"
    Private Rate As Single = 1
    Private Handle As IntPtr
    Private DecodageMateriel As Boolean = True
    Private PostProc As Integer = 6
    Private Sharpen As String = "0.1"
    Private _AspectRatio As AspectRatioMode = AspectRatioMode.Default
    Private fichier As String = String.Empty
    Private NormSon As Boolean = False
    Private compensatePalSpeedUp As Boolean = False
    Private ValueCompensationPalSpeedup As Single = 1.0
    Private Teletext As New Dictionary(Of Integer, String)
    Public Event ChannelChanged(ByVal strchaine As String)
    Public Event ChannelChanging()
    Private RestartSameStream As Boolean = False


#Region "Methode"
    Public Sub ToggleTeletext()
        vlcplayer.Video.ToggleTeleText()
    End Sub
    Public Sub Snapshot(ByVal SnapshotFilename As String)
        vlcplayer.Video.TakeSnapShot(SnapshotFilename, vlcplayer.Video.Width, vlcplayer.Video.Height)
    End Sub

    Public Sub VolumePlus()
        Volume = Math.Min(Volume + 5, 200)
    End Sub

    Public Sub VolumeMoins()
        Volume = Math.Max(Volume - 5, 0)
    End Sub

    Public Sub DisposeVlcPlayer()
        'contournement du deadlock de la libvlc en mettant les disposes dans un thread different
        Dim th As Thread = New Thread(New ThreadStart(AddressOf release))
        th.Start()
        th.Join(10000)
    End Sub

    Private Sub release()
        vlc.Dispose()
        vlcplayer.Dispose()
    End Sub

    Public Sub InitVlcPlayer(ByVal HandleVideo As IntPtr)
        Dim Render As String = ""
        If osversion = 5 Then
            Render = "Directx"
        ElseIf osversion >= 6 Then
            Render = "Direct3d"
        End If

        Dim args() As String = {AppDomain.CurrentDomain.BaseDirectory, "--no-one-instance", "--no-loop", "--no-video-title-show", "--overlay", "--aout=matrix_directx", "--vout=" & Render, "--no-audio-time-stretch"}

        vlc = New VideoLanClient(args)
        vlcplayer = vlc.NewMediaPlayer()

        Handle = HandleVideo
    End Sub

    Public Sub InitMedia(ByVal d As String, ByVal dm As Integer, ByVal pp As Integer, ByVal hdw As Boolean, ByVal sh As String, ByVal sws As Integer, ByVal nv As Boolean, ByVal slf As Integer)
        DesentrelacementMode = DirectCast(dm, DeinterlaceMode)
        Select Case d
            Case Deinterlace.Auto.ToString
                Desentrelacement = Deinterlace.Auto
            Case Deinterlace.Off.ToString
                Desentrelacement = Deinterlace.Off
            Case Deinterlace.On.ToString
                Desentrelacement = Deinterlace.On
            Case Else
                ' comment vous êtes arrivé là !
        End Select
        PostProc = pp
        DecodageMateriel = hdw
        Sharpen = sh
        RedimensionnementSoftware = DirectCast(sws, Redimensionnement)
        NormSon = nv
        sautBoucle = DirectCast(slf, SkipLoopFilter)
    End Sub

    Public Sub Watch(Optional ByVal File1 As String = "")
        RaiseEvent ChannelChanging()
        Dim strchaine As String
        Dim MemoTrackAudio As Integer = TrackAudio
        Dim MemoSousTitre As Integer = SousTitre
        If File1.Length = 0 AndAlso fichier.Length = 0 Then
            strchaine = WatchTV()
        Else
            If fichier <> "" Then
                strchaine = WatchFile(fichier)
            Else
                strchaine = WatchFile(File1)
            End If

        End If
        If RestartSameStream Then
            TrackAudio = MemoTrackAudio
            SousTitre = MemoSousTitre
            RestartSameStream = False
        End If
        Thread.Sleep(4000)
        RaiseEvent ChannelChanged(strchaine)
    End Sub
    Public Sub StopMedia()
        Dim th As Thread = New Thread(New ThreadStart(AddressOf StopVideo))
        th.Start()
        th.Join(10000)
    End Sub
    Private Sub StopVideo()
        Dim vmc As VlcMediaPlayer = vlcplayer
        If vmc IsNot Nothing Then
            vmc.Stop()
        End If
    End Sub

    Private Function WatchTV() As String
        fichier = String.Empty
        'vlcplayer.Stop()
        'contournement du deadlock de la libvlc en mettant le stop dans un thread different
        Dim th As Thread = New Thread(New ThreadStart(AddressOf StopVideo))
        th.Start()
        th.Join(10000)


        Dim Media As VlcMedia = vlc.NewMedia(Location) 'libvlc_media_new_location
        If Extension.Count > 0 Then
            For t As Integer = 1 To Extension.Count - 1
                Media.AddOption(Extension(t)) ' libvlc_media_add_option
            Next

        End If
        If SilentRecording Then
            Media.AddOption(String.Concat("sout=#file{mux=ts,dst=""", RecordFileName, """ }")) 'libvlc_media_add_option
        Else
            If Desentrelacement <> Deinterlace.Off Then
                Media.AddOption(":vout-filter=deinterlace")
                Media.AddOption(String.Concat(":deinterlace=", Desentrelacement)) 'libvlc_media_add_option
                Media.AddOption(String.Concat(":filter-deinterlace-mode=", GetEnumDescription(DesentrelacementMode))) 'libvlc_media_add_option
            End If
            If Recording And Not (RecordFileName.Equals("")) Then
                Media.AddOption(String.Concat(":sout=#duplicate{dst=display,dst=std{access=file,mux=ts,dst=""", RecordFileName, """ }}"))
            End If

            If PostProc > 0 OrElse Not Sharpen.Equals("0") OrElse RedimensionnementSoftware > Redimensionnement.defaut Then
                Dim videofileter As New StringBuilder
                videofileter.Append(":video-filter=")
                If PostProc > 0 Then
                    videofileter.Append("postproc:")
                End If
                If RedimensionnementSoftware > Redimensionnement.defaut Then
                    videofileter.Append("swscale:")
                End If
                If Not Sharpen.Equals("0") Then
                    videofileter.Append("sharpen:")
                End If

                Media.AddOption(videofileter.ToString)

                If PostProc > 0 Then
                    Media.AddOption(String.Concat(":postproc-q=", PostProc))
                End If
                If RedimensionnementSoftware > Redimensionnement.defaut Then
                    Media.AddOption(String.Concat(":swscale-mode=", RedimensionnementSoftware))
                End If
                If Not SharpenSigma.Equals("0") Then
                    Media.AddOption(":sharpen-sigma=" & Sharpen)
                End If

            End If
            If DecodageMateriel Then
                Media.AddOption(":ffmpeg_hw")
            End If
            Media.AddOption(":ffmpeg-skiploopfilter=" & sautBoucle)
            If NormSon Then
                Media.AddOption(":audio-filter=normvol")
                Media.AddOption(":norm-buff-size=20")
                Media.AddOption(":norm-max-level=2.0")
            End If
        End If

        vlcplayer.Load(Media) 'libvlc_media_player_set_media
        vlcplayer.Play(Handle) 'libvlc_media_player_set_hwnd , libvlc_media_player_play

        'Boucle d'attente
        Dim timeout As Integer = 0
        Do Until (vlcplayer.State = VideoLan.VlcState.Playing) Or (timeout > 150)
            Threading.Thread.Sleep(50)
            'Trace.Write("timeout=" & timeout.ToString & Environment.NewLine)
            timeout += 1
        Loop
        Media.Dispose()
        Threading.Thread.Sleep(350) 'encore un peu d'attente
        'If Not DisplayOSD Then
        '    Mainform.AfficheOSDChaine(Ordering.ToString & " - " & title)
        'End If
        Return Ordering.ToString & " - " & title
    End Function


    Private Function WatchFile(ByVal file As String) As String
        fichier = file
        'vlcplayer.Stop()
        'contournement du deadlock de la libvlc en mettant le stop dans un thread different
        Dim th As Thread = New Thread(New ThreadStart(AddressOf StopVideo))
        th.Start()
        th.Join(10000)

        Dim Media As VlcMedia = vlc.NewMedia(file) 'libvlc_media_new_location
        If Desentrelacement <> Deinterlace.Off Then
            Media.AddOption("vout-filter=deinterlace")
            Media.AddOption(String.Concat("deinterlace=", Desentrelacement)) 'libvlc_media_add_option
            Media.AddOption(String.Concat("filter-deinterlace-mode=", GetEnumDescription(DesentrelacementMode))) 'libvlc_media_add_option
        End If
        If PostProc > 0 OrElse Not Sharpen.Equals("0") OrElse RedimensionnementSoftware > Redimensionnement.defaut Then
            Dim videofileter As New StringBuilder
            videofileter.Append("video-filter=")
            If PostProc > 0 Then
                videofileter.Append("postproc:")
            End If
            If RedimensionnementSoftware > Redimensionnement.defaut Then
                videofileter.Append("swscale:")
            End If
            If Not Sharpen.Equals("0") Then
                videofileter.Append("sharpen:")
            End If

            Media.AddOption(videofileter.ToString)

            If PostProc > 0 Then
                Media.AddOption(String.Concat("postproc-q=", PostProc))
            End If
            If RedimensionnementSoftware > Redimensionnement.defaut Then
                Media.AddOption(String.Concat("swscale-mode=", RedimensionnementSoftware))
            End If
            If Not SharpenSigma.Equals("0") Then
                Media.AddOption("sharpen-sigma=" & Sharpen)
            End If

        End If
        If DecodageMateriel Then
            Media.AddOption("ffmpeg_hw")
        End If
        Media.AddOption("ffmpeg-skiploopfilter=" & sautBoucle)
        If NormSon Then
            Media.AddOption("audio-filter=normvol")
            Media.AddOption("norm-buff-size=20")
            Media.AddOption("norm-max-level=2.0")
        End If

        vlcplayer.Load(Media) 'libvlc_media_player_set_media
        vlcplayer.Play(Handle) 'libvlc_media_player_set_hwnd , libvlc_media_player_play
        Dim timeout As Integer = 0
        Do Until (vlcplayer.State = VideoLan.VlcState.Playing) Or (timeout > 150)
            Threading.Thread.Sleep(50)
            timeout += 1
        Loop
        Threading.Thread.Sleep(350)
        'Mainform.AfficheOSDChaine(FileName)
        Return FileName
    End Function

    Public Sub ToggleMute()

        'Contournement du bug de togglemute de vlc 1.1.10
        'à supprimer dés que possible
        Static memvolume As Integer
        If vlcplayer.Audio.Mute = True Then
            vlcplayer.Audio.Volume = memvolume
            vlcplayer.Audio.Mute = False
        Else
            memvolume = vlcplayer.Audio.Volume
            vlcplayer.Audio.Mute = True
        End If
        'fin de contournement

        'a remettre dés que possible
        'vlcplayer.Audio.ToggleMute()
    End Sub

    Public Sub Pause()
        If IsCreated Then
            vlcplayer.Pause()
        End If
    End Sub

    Public Sub Play()
        If IsCreated Then
            vlcplayer.Play(Handle)
        End If
    End Sub

    Public Sub Accelerate()
        Select Case Rate
            Case 0.12
                Rate = 0.25
            Case 0.25
                Rate = 0.33
            Case 0.33
                Rate = 0.5
            Case 0.5
                Rate = 0.66
            Case 0.66
                Rate = 0.75
            Case 0.75
                Rate = 1
            Case 1
                Rate = 1.5
            Case 1.5
                Rate = 2
            Case 2
                Rate = 3
            Case 3
                Rate = 4
            Case 4
                Rate = 8
            Case 8
                Rate = 16
            Case 16
                Rate = 32
        End Select
        vlcplayer.Rate = Rate * ValueCompensationPalSpeedup
    End Sub

    Public Sub Decelerate()
        Select Case Rate
            Case 0.25
                Rate = 0.12
            Case 0.33
                Rate = 0.25
            Case 0.5
                Rate = 0.33
            Case 0.66
                Rate = 0.5
            Case 0.75
                Rate = 0.66
            Case 1
                Rate = 0.75
            Case 1.5
                Rate = 1
            Case 2
                Rate = 1.5
            Case 3
                Rate = 2
            Case 4
                Rate = 3
            Case 8
                Rate = 4
            Case 16
                Rate = 8
            Case 32
                Rate = 16
        End Select
        vlcplayer.Rate = Rate * ValueCompensationPalSpeedup
    End Sub

    Public Sub ToggleCompensatePalSpeedUp()

        compensatePalSpeedUp = Not compensatePalSpeedUp
        If compensatePalSpeedUp Then
            ValueCompensationPalSpeedup = 0.96
        Else
            ValueCompensationPalSpeedup = 1.0
        End If
        vlcplayer.Rate = Rate * ValueCompensationPalSpeedup
    End Sub
#End Region

#Region "utils"
    Public Function GetEnumDescription(ByVal value As [Enum]) As String
        Dim fi As FieldInfo = value.[GetType]().GetField(value.ToString())
        Dim attributes As DescriptionAttribute() = DirectCast(fi.GetCustomAttributes(GetType(DescriptionAttribute), False), DescriptionAttribute())

        If Not attributes Is Nothing AndAlso attributes.Length > 0 Then
            Return attributes(0).Description
        Else
            Return value.ToString()
        End If
    End Function
#End Region

#Region "Property"
    Public ReadOnly Property HasAudio As Boolean
        Get
            Return vlcplayer.Audio.TrackCount > 0
        End Get
    End Property
    Public ReadOnly Property HasVideo As Boolean
        Get
            Return vlcplayer.HasVout
        End Get
    End Property
    Public Property PageTeletext As Integer
        Get
            Return vlcplayer.Video.TeleText
        End Get
        Set(ByVal value As Integer)
            vlcplayer.Video.TeleText = value
        End Set
    End Property
    Public ReadOnly Property ListeSousTitre As Dictionary(Of Integer, String)
        Get
            Teletext.Clear()
            Dim nbSoustitre As Integer = vlcplayer.Video.SPUCount
            If nbSoustitre >= 2 Then
                Dim listST As New Dictionary(Of Integer, String)
                Dim listSTFrench As New Dictionary(Of Integer, String)
                listST = vlcplayer.Video.SPUList
                For Each soustitre As KeyValuePair(Of Integer, String) In listST
                    If soustitre.Value.Contains("Disable") Then
                        listSTFrench.Add(soustitre.Key, soustitre.Value.Replace("Disable", "Désactiver"))
                        Teletext.Add(soustitre.Key, soustitre.Value.Replace("Disable", "Désactiver"))
                    ElseIf Not soustitre.Value.Contains("Teletext") Then
                        listSTFrench.Add(soustitre.Key, soustitre.Value.Replace("hearing impaired", "Sourds et malentendants"))
                    Else
                        Teletext.Add(soustitre.Key, soustitre.Value)
                    End If
                Next
                Return listSTFrench
            Else
                Dim SansST As New Dictionary(Of Integer, String)
                SansST.Add(1, "Pas de sous-titre")
                Return SansST
            End If

        End Get
    End Property

    Public ReadOnly Property ListTeletext As Dictionary(Of Integer, String)
        Get
            Return Teletext
        End Get
    End Property

    Public ReadOnly Property IsCreated As Boolean
        Get
            Return vlcplayer IsNot Nothing
        End Get
    End Property



    Public Property SousTitre As Integer
        Get
            Return vlcplayer.Video.SPU
        End Get
        Set(ByVal value As Integer)
            vlcplayer.Video.SPU = value
        End Set
    End Property

    Public ReadOnly Property ListeTrackAudio As Dictionary(Of Integer, String)
        Get
            Dim nbAudio As Integer = vlcplayer.Audio.TrackCount
            If nbAudio >= 2 Then
                Dim listTrack As New Dictionary(Of Integer, String)
                Dim listtrackFrench As New Dictionary(Of Integer, String)
                listTrack = vlcplayer.Audio.TrackList
                For Each trackAudio As KeyValuePair(Of Integer, String) In listTrack
                    If Not trackAudio.Value.Contains("Disable") Then
                        listtrackFrench.Add(trackAudio.Key, trackAudio.Value.Replace("Track", "").Replace("qad", "Audio description"))
                    End If
                Next
                Return listtrackFrench
            Else
                Dim SansAudio As New Dictionary(Of Integer, String)
                SansAudio.Add(0, "Pas d'audio !!!")
                Return SansAudio
            End If
        End Get
    End Property

    Public Property TrackAudio As Integer
        Get
            Return vlcplayer.Audio.Track
        End Get
        Set(ByVal value As Integer)
            vlcplayer.Audio.Track = value
        End Set
    End Property

    Public ReadOnly Property IsMute As Boolean
        Get
            Return vlcplayer.Audio.Mute
        End Get
    End Property

    Public ReadOnly Property CompensationPalSpeedUp As Boolean
        Get
            Return compensatePalSpeedUp
        End Get
    End Property

    Public Property CropGeometry As String
        Get
            Return vlcplayer.Video.CropGeometry
        End Get
        Set(ByVal value As String)
            vlcplayer.Video.CropGeometry = value
        End Set
    End Property

    Public Property AjustVideoEnable As Boolean
        Get
            Return vlcplayer.Video.AjustVideoEnable
        End Get
        Set(ByVal value As Boolean)
            vlcplayer.Video.AjustVideoEnable = value
        End Set
    End Property

    Public Property Contrast As Single
        Get
            Return vlcplayer.Video.Contrast
        End Get
        Set(ByVal value As Single)
            vlcplayer.Video.Contrast = value
        End Set
    End Property

    Public Property Brightness As Single
        Get
            Return vlcplayer.Video.Brightness
        End Get
        Set(ByVal value As Single)
            vlcplayer.Video.Brightness = value
        End Set
    End Property

    Public Property Hue As Integer
        Get
            Return vlcplayer.Video.Hue
        End Get
        Set(ByVal value As Integer)
            vlcplayer.Video.Hue = value
        End Set
    End Property

    Public Property Saturation As Single
        Get
            Return vlcplayer.Video.Saturation
        End Get
        Set(ByVal value As Single)
            vlcplayer.Video.Saturation = value
        End Set
    End Property

    Public Property Gamma As Single
        Get
            Return vlcplayer.Video.Gamma
        End Get
        Set(ByVal value As Single)
            vlcplayer.Video.Gamma = value
        End Set
    End Property

    Public Property AspectRatio As AspectRatioMode
        Get
            Return _AspectRatio
        End Get
        Set(ByVal value As AspectRatioMode)
            vlcplayer.Video.AspectRatio = GetEnumDescription(value)
            _AspectRatio = value
        End Set
    End Property

    Public ReadOnly Property Speed As String
        Get
            Return Rate.ToString & "X"
        End Get
    End Property

    Public Property RecordNow As Boolean
        Get
            Return Recording
        End Get
        Set(ByVal value As Boolean)
            If Recording <> value Then
                DisplayOSD = True
                Recording = value
                Watch()
                DisplayOSD = False
            End If
        End Set
    End Property

    Public Property FileName As String
        Get
            Return RecordFileName
        End Get
        Set(ByVal value As String)
            RecordFileName = value
        End Set
    End Property

    Public Property Volume As Integer
        Get
            Return vlcplayer.Audio.Volume
        End Get
        Set(ByVal value As Integer)
            vlcplayer.Audio.Volume = value
        End Set
    End Property

    Public Property desentrelace As String
        Get
            Return Desentrelacement.ToString
        End Get
        Set(ByVal value As String)
            If Not value.Equals(Desentrelacement) Then
                Select Case value
                    Case Deinterlace.Auto.ToString
                        Desentrelacement = Deinterlace.Auto
                    Case Deinterlace.Off.ToString
                        Desentrelacement = Deinterlace.Off
                    Case Deinterlace.On.ToString
                        Desentrelacement = Deinterlace.On
                    Case Else
                        ' comment vous êtes arrivé là !
                End Select
                DisplayOSD = True
                RestartSameStream = True
                Watch()
                DisplayOSD = False
            End If
        End Set
    End Property

    Public Property PostProcessus As Integer
        Get
            Return PostProc
        End Get
        Set(ByVal value As Integer)
            If PostProc <> value Then
                PostProc = value
                DisplayOSD = True
                RestartSameStream = True
                Watch()
                DisplayOSD = False
            End If
        End Set
    End Property

    Public Property SharpenSigma As String
        Get
            Return Sharpen
        End Get
        Set(ByVal value As String)
            If Not Sharpen.Equals(value) Then
                Sharpen = value
                DisplayOSD = True
                RestartSameStream = True
                Watch()
                DisplayOSD = False
            End If
        End Set
    End Property

    Public Property ModeDesentrelace As DeinterlaceMode
        Get
            Return DesentrelacementMode
        End Get
        Set(ByVal value As DeinterlaceMode)
            If value <> DesentrelacementMode Then
                DesentrelacementMode = value
                If Desentrelacement <> Deinterlace.Off Then
                    vlcplayer.Video.DeinterlaceMode = GetEnumDescription(DesentrelacementMode)
                    'Watch()
                End If
            End If
        End Set
    End Property

    Public ReadOnly Property isPlaying As Boolean
        Get
            Return vlcplayer.IsPlaying
        End Get
    End Property

    Public Property SWScaleMode As Redimensionnement
        Get
            Return RedimensionnementSoftware
        End Get
        Set(ByVal value As Redimensionnement)
            If value <> RedimensionnementSoftware Then
                RedimensionnementSoftware = value
                DisplayOSD = True
                RestartSameStream = True
                Watch()
                DisplayOSD = False
            End If
        End Set
    End Property

    Public Property HardwareDecoding As Boolean
        Get
            Return DecodageMateriel
        End Get
        Set(ByVal value As Boolean)
            If DecodageMateriel <> value Then
                DecodageMateriel = value
                DisplayOSD = True
                RestartSameStream = True
                Watch()
                DisplayOSD = False
            End If
        End Set
    End Property

    Public Property NormalisationVolume As Boolean
        Get
            Return NormSon
        End Get
        Set(ByVal value As Boolean)
            If NormSon <> value Then
                NormSon = value
                DisplayOSD = True
                RestartSameStream = True
                Watch()
                DisplayOSD = False
            End If
        End Set
    End Property

    Public Property SautFilterBoucle As SkipLoopFilter
        Get
            Return sautBoucle
        End Get
        Set(ByVal value As SkipLoopFilter)
            If value <> sautBoucle Then
                sautBoucle = value
                DisplayOSD = True
                RestartSameStream = True
                Watch()
                DisplayOSD = False
            End If
        End Set
    End Property
    Public ReadOnly Property Hauteur As Integer
        Get
            Return CInt(vlcplayer.Video.Height)
        End Get
    End Property
    Public ReadOnly Property Largeur As Integer
        Get
            Return CInt(vlcplayer.Video.Width)
        End Get
    End Property

#End Region

#Region "Enum"

    Public Enum Deinterlace
        <Description("Auto")> _
        Auto = -1
        <Description("Off")> _
        Off = 0
        <Description("On")> _
        [On] = 1
    End Enum
    Public Enum DeinterlaceMode
        <Description("discard")> _
        discard
        <Description("blend")> _
        blend
        <Description("mean")> _
        mean
        <Description("bob")> _
        bob
        <Description("linear")> _
        linear
        <Description("x")> _
        x
        <Description("yadif")> _
        yadif
        <Description("yadif2x")> _
        yadif2x

    End Enum
    Public Enum AspectRatioMode
        <Description("Auto")> _
        [Default] = 0
        <Description("1:1")> _
        Mode1
        <Description("4:3")> _
        Mode2
        <Description("16:9")> _
        Mode3
        <Description("16:10")> _
        Mode4
        <Description("2.21:1")> _
        Mode5
        <Description("2.35:1")> _
        Mode6
        <Description("2:39:1")> _
        Mode7
        <Description("5:4")> _
        Mode8
    End Enum
    Public Enum Redimensionnement
        <Description("Défaut")> _
            defaut = -1
        <Description("Bilinéaire rapide")> _
            Fastbilinear = 0
        <Description("Bilinéaire")> _
            Bilinear
        <Description("Bicubique")> _
            Bicubic
        <Description("Expérimental")> _
            Experimental
        <Description("Plus proche voisin")> _
            NearBorrough
        <Description("Zone")> _
            Zone
        <Description("Bicubique/bilinéaire")> _
            BicubicBilinear
        <Description("Gaussien")> _
            Gaussian
        <Description("SincR")> _
            SincR
        <Description("Lanczos")> _
            Lanczos
        <Description("Courbe Bicubique")> _
            BicubicCurve

    End Enum
    Public Enum SkipLoopFilter
        <Description("Aucun")> _
            Aucun = 0
        <Description("Non-ref")> _
            Nonref
        <Description("Bidir")> _
            Bidir
        <Description("Non-key")> _
            Nonkey
        <Description("Tous")> _
            tous
    End Enum

#End Region

End Module
